package com.lanqiao.javaparkinglot.dao;

import com.lanqiao.javaparkinglot.entity.Driverhs;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Mapper
public interface DriverhsDao {
    //查询
    @Select("select * from tb_hssj")
    List<Driverhs> findsjhs();
    //添加
    @Update("insert into tb_hssj (hss_id, hss_name, hss_sex, hss_number, hss_card, hss_car, hss_nhome, hss_result)VALUES (#{hss_id},#{hss_name},#{hss_sex},#{hss_number},#{hss_card},#{hss_car},#{hss_nhome},#{hss_result})")
    @Transactional
    void addsjhs(Driverhs driverhs);
    //修改
    @Update("update tb_hssj set hss_id=#{hss_id},hss_name=#{hss_name}, hss_sex=#{hss_sex}, hss_number=#{hss_number}, hss_card=#{hss_card}, hss_car=#{hss_car},hss_nhome=#{hss_nhome}, hss_result=#{hss_result} where hss_id=#{hss_id}")
    @Transactional
    void updatesjsh(Driverhs driverhs);
    //删除
    @Delete("delete from tb_hssj where hss_id=#{hss_id}")
    void deletesjhs(Long hss_id);
}
